package com.xyw.code.efficient_programming.lambda.file;

import java.io.*;

/**
 * Created by xuyiwei on 2020/1/6 11:18
 */
public class FileLambda {
    public static void fileDetail(String url,FileConsume fileConsume) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(url)));
        StringBuffer sb = new StringBuffer();
        String line;
        while ((line=br.readLine())!=null){
            sb.append(line+"\n");
        }
        fileConsume.detail(sb.toString());

    }
}
